//package com.example.myapplication;
//
//import android.os.Bundle;
//import android.view.View;
//import android.widget.Button;
//import android.widget.EditText;
//
//import androidx.appcompat.app.AppCompatActivity;
//import androidx.recyclerview.widget.LinearLayoutManager;
//import androidx.recyclerview.widget.RecyclerView;
//import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
//
//import com.example.myapplication.adapter.MsgAdapter;
//import com.example.myapplication.entity.Msg;
//
//import java.util.ArrayList;
//import java.util.List;
//
//public class SensitiveInfoActivity extends AppCompatActivity {
//
////    MsgAdapter msgAdapter = new MsgAdapter();
//    private int mLimit = 2;//历史消息页数
//    //适配器
//    private MsgAdapter adapter;
//    //确定数据结构，初始化数据
//    private List<Msg> mList = new ArrayList<>();
//
//    private final int MESSAGE_ERROR = 0; //错误信息
//    private final int MESSAGE_SUCCEED = 1; //连接成功
//    private final int MESSAGE_RECEIVE = 2; //收到消息
//    private final int MESSAGE_FINISH = 3;  //会话结束
//    private final int MESSAGE_REFRESH = 4; //初始化消息
//    private final int MESSAGE_HISTORY = 5; //更多历史数据
//
//    protected void onCreate(Bundle savedInstanceState) {
//        super.onCreate(savedInstanceState);
//        setContentView(R.layout.activity_sensitiveinfo);
//        //去除上方导航框
//        if (getSupportActionBar() != null) {
//            getSupportActionBar().hide();
//        }
//        //聊天输入
//        EditText et_input = (EditText) findViewById(R.id.chat_input);
//
//
//        SwipeRefreshLayout swipeRefresh = (SwipeRefreshLayout) findViewById(R.id.swipeRefresh);
//        intData();
//        //敏感信息展示的聊天内容框
//        RecyclerView sensitive_info = (RecyclerView) findViewById(R.id.sensitive_info);
//        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
//        linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
//        sensitive_info.setLayoutManager(linearLayoutManager);
//        MsgAdapter msgAdapter = new MsgAdapter(SensitiveInfoActivity.this,mList);
//        sensitive_info.setAdapter(msgAdapter);
//        //发送更多信息
//        Button tv_send = (Button) findViewById(R.id.tv_send);
//        tv_send.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                // 处理点击事件的代码
//                Msg msg1 = new Msg(et_input.getText().toString(),System.currentTimeMillis(),Msg.SEND_MSG);
//                mList.add(msg1);
//                //通知适配器有新的项被插入
//                msgAdapter.notifyItemInserted(mList.size()-1);
//                sensitive_info.scrollToPosition(mList.size()-1);
//                et_input.setText("");
//            }
//        });
//
//    }
//
//
//    //初始化数据
//    public void intData(){
//        mList.add(new Msg("我是智能桌宠竹马",2,Msg.RECEIVE_MSG));
//        mList.add(new Msg("很高兴见到你",2,Msg.SEND_MSG));
//        mList.add(new Msg("我们将和您一起呵护孩子的成长",2,Msg.RECEIVE_MSG));
//    }
//
//
//
//}
